package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.javabean.Permission;

import java.util.List;

public interface PermissionMapper {
    List<Permission> selectAll();
    @Insert("insert into permission (permissionName,url) values(#{permissionName},#{url})")
    int insert(Permission permission);
    @Select("select * from permission where id=#{id}")
    Permission selectById(int id);
    @Update("update permission set permissionName=#{permissionName},url=#{url} where id=#{id}")
    int updateById(Permission permission);
    @Delete("delete from permission where id=#{id}")
    int deleteById(int id);
}
